package com.bdjk.bdmw.InfoGath.business.beianbei.vo;
import java.text.ParseException;
import com.alibaba.druid.util.StringUtils;
import com.bdjk.bdmw.InfoGath.business.beianbei.model.BeiAnBeiPositionModel;
import com.bdjk.bdmw.InfoGath.common.constants.InfoGathConstants;
import com.bdjk.bdmw.InfoGath.common.vo.BaseVO;

public class BeiAnBeiPositionVO extends BaseVO {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
		// id
		private String id;
		//通信标准
		private String commType;
		// 设备唯一标识
		private String terIdent;
		// 对应协议编码
		private String proCode;
		// 终端发送时间
		private String sendTime;
		// 是否定位
		private String isEchoLocation;
		// 经度
		private String longitude;
		// 纬度
		private String latitude;
		// 速度
		private String speed;
		// 方向
		private String direction;
		// 海拔
		private String altitude;
		// 卫星数量
		private String satelliteNum;
		// gsm型号强度
		private String gsmSignStrength;
		// 电量
		private String electricity;
		// 记步数
		private String stepNum;
		// 翻滚数
		private String rollNum;
		// 终端状态
		// 01：sos报警   02：蓝牙端口报警   04：出围栏报警   08：低电量报警   10：取手环报警
		private String terStatus;
		// 基站信息
		private String baseInfo;
		// wifi信息
		private String wifiInfo;
		private String msgLength;
		
		public String getId() {
			return id;
		}
		public void setId(String id) {
			this.id = id;
		}
		public String getLongitude() {
			return longitude;
		}
		public void setLongitude(String longitude) {
			this.longitude = longitude;
		}
		public String getLatitude() {
			return latitude;
		}
		public void setLatitude(String latitude) {
			this.latitude = latitude;
		}
		public String getSpeed() {
			return speed;
		}
		public void setSpeed(String speed) {
			this.speed = speed;
		}
		public String getDirection() {
			return direction;
		}
		public void setDirection(String direction) {
			this.direction = direction;
		}
		public String getAltitude() {
			return altitude;
		}
		public void setAltitude(String altitude) {
			this.altitude = altitude;
		}

		public String getTerIdent() {
			return terIdent;
		}
		public void setTerIdent(String terIdent) {
			this.terIdent = terIdent;
		}
		public String getProCode() {
			return proCode;
		}
		public void setProCode(String proCode) {
			this.proCode = proCode;
		}
		public String getSendTime() {
			return sendTime;
		}
		public void setSendTime(String sendTime) {
			this.sendTime = sendTime;
		}
		public String getIsEchoLocation() {
			return isEchoLocation;
		}
		public void setIsEchoLocation(String isEchoLocation) {
			this.isEchoLocation = isEchoLocation;
		}
		public String getSatelliteNum() {
			return satelliteNum;
		}
		public void setSatelliteNum(String satelliteNum) {
			this.satelliteNum = satelliteNum;
		}
		public String getGsmSignStrength() {
			return gsmSignStrength;
		}
		public void setGsmSignStrength(String gsmSignStrength) {
			this.gsmSignStrength = gsmSignStrength;
		}
		public String getElectricity() {
			return electricity;
		}
		public void setElectricity(String electricity) {
			this.electricity = electricity;
		}
		public String getStepNum() {
			return stepNum;
		}
		public void setStepNum(String stepNum) {
			this.stepNum = stepNum;
		}
		public String getRollNum() {
			return rollNum;
		}
		public void setRollNum(String rollNum) {
			this.rollNum = rollNum;
		}
		public String getTerStatus() {
			return terStatus;
		}
		public void setTerStatus(String terStatus) {
			this.terStatus = terStatus;
		}
		
		public String getCommType() {
			return commType;
		}
		public void setCommType(String commType) {
			this.commType = commType;
		}
		public String getBaseInfo() {
			return baseInfo;
		}
		public void setBaseInfo(String baseInfo) {
			this.baseInfo = baseInfo;
		}
		public String getWifiInfo() {
			return wifiInfo;
		}
		public void setWifiInfo(String wifiInfo) {
			this.wifiInfo = wifiInfo;
		}
		
		public String getMsgLength() {
			return msgLength;
		}
		public void setMsgLength(String msgLength) {
			this.msgLength = msgLength;
		}
		@Override
		public BeiAnBeiPositionModel vo2Model() throws ParseException{
			BeiAnBeiPositionModel model = new BeiAnBeiPositionModel();
			if(!StringUtils.isEmpty(this.id)){
				model.setId(Integer.valueOf(this.id));
			}
			model.setCommType(this.commType);
			model.setTerIdent(this.terIdent);
			model.setProCode(this.proCode);
			if (null != this.sendTime) {
				model.setSendTime(InfoGathConstants.SDF.parse(this.sendTime));
			}
			model.setIsEchoLocation(this.isEchoLocation);
			model.setLongitude(this.longitude);
			model.setLatitude(this.latitude);
			if(!StringUtils.isEmpty(this.speed)){
				model.setSpeed(Double.valueOf(this.speed));
			}
			if(!StringUtils.isEmpty(this.direction)){
				model.setDirection(Double.valueOf(this.direction));
			}
			if(!StringUtils.isEmpty(this.altitude)){
				model.setAltitude(Double.valueOf(this.altitude));
			}
			if(!StringUtils.isEmpty(this.satelliteNum)){
				model.setSatelliteNum(Integer.valueOf(this.satelliteNum));
			}
			if(!StringUtils.isEmpty(this.gsmSignStrength)){
				model.setGsmSignStrength(Double.valueOf(this.gsmSignStrength));
			}
			if(!StringUtils.isEmpty(this.electricity)){
				model.setElectricity(Integer.valueOf(this.electricity));
			}
			if(!StringUtils.isEmpty(this.stepNum)){
				model.setStepNum(Integer.valueOf(this.stepNum));
			}
			if(!StringUtils.isEmpty(this.rollNum)){
				model.setRollNum(Integer.valueOf(this.rollNum));
			}
			model.setTerStatus(this.terStatus);
			model.setBaseInfo(this.baseInfo);
			model.setWifiInfo(this.wifiInfo);
			return  model;
		}
		
		
		
	}
